name | correct guesses | games together | ratio |
---|
name | correct guesses | games together | ratio |
---|---|---|---|
Olivia | 1 | 4 | 0.250 |
IFcoltransG | 0 | 4 | 0.000 |
razetime | 0 | 4 | 0.000 |
quintopia | 0 | 4 | 0.000 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #include <ctype.h> void remove_spaces(char* s) { // https://stackoverflow.com/questions/1726302/removing-spaces-from-a-string-in-c const char* d = s; do { while (*d == ' ') { ++d; } } while ((*s++ = tolower(*d++))); // modified } #define NO_OF_CHARS 256 int areAnagram(char* str1, char* str2) // https://www.geeksforgeeks.org/check-whether-two-strings-are-anagram-of-each-other/ { // Create 2 count arrays and initialize all values as 0 int count1[NO_OF_CHARS] = { 0 }; int count2[NO_OF_CHARS] = { 0 }; int i; // For each character in input strings, increment count // in the corresponding count array for (i = 0; str1[i] && str2[i]; i++) { count1[str1[i]]++; count2[str2[i]]++; } // If both strings are of different length. Removing // this condition will make the program fail for strings // like "aaca" and "aca" if (str1[i] || str2[i]) return 0; // Compare count arrays for (i = 0; i < NO_OF_CHARS; i++) if (count1[i] != count2[i]) return 0; return 1; } int entry(char *s1, char* s2) { remove_spaces(s1); remove_spaces(s2); return areAnagram(s1, s2); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import operator class Entrant: class Matrix: # for easy iteration, otherwise cryoapioforms. def __init__(self,rows): self.rows = rows self.cols = [[i[j] for i in rows] for j in range(len(rows))] def lace(self,f,g,a,b): # f is binary, g applies over a list. c = [[] for i in a.cols] for i in range(len(a.rows)): d = a.rows[i] for j in b.cols: c[i].append(g(f(d[k],j[k]) for k in range(len(d)))) # jk return self.Matrix(c) # no, enums are still bad. def __call__(self,a,b): return self.lace(operator.mul,sum,self.Matrix(a),self.Matrix(b)).rows entry = Entrant() # classes, hmm. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | def entry(iAr): # Bad Tremaux impl cPos = 0; pPos = None psgs = [set() for i in range(100)] def isIs(pos, prev): # Not confusing at all paths = {k:0 for k in (pos-10, pos-1, pos+1, pos+10)} for k in paths: try: if not iAr[k]: paths[k] = 1 except IndexError: pass paths[prev] = 0 if pos < 10: paths[pos-10] = 0 if not pos % 10: paths[pos-1] = 0 if pos % 10 == 9: paths[pos+1] = 0 return [k for k in paths if paths[k]] # Should I rename this? ... Nah def isV(pos): for i in psgs[pos]: if i: return True return False def isB(pos, prev): for i in psgs[pos]: if i == prev: return True return False # I hate this so much while cPos != 99: paths = isIs(cPos, pPos) if isV(cPos): if isB(cPos, pPos): unv = list(filter(lambda y: not isV(y), paths)) if not unv: unv = set(isIs(cPos, pPos)) - psgs[cPos] pPos = cPos cPos = unv.pop() else: cPos, pPos = pPos, cPos else: if len(paths): pPos = cPos cPos = paths.pop() else: cPos, pPos = pPos, cPos psgs[pPos].add(cPos) def compare(pos, nxt): if nxt == pos - 10: return 1 elif nxt == pos + 1: return 2 elif nxt == pos + 10: return 3 else: return 4 cPos = 0; oAr = [] while cPos != 99: nPos = tuple(psgs[cPos])[-1] oAr.append(compare(cPos, nPos)) cPos = nPos return oAr |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #!/bin/python3 from collections import Counter def countsort(input_array): 'Sorts and returns a given list using counting sort.' # Storing counts of each integer integer_counts = Counter(input_array) # Cascade positional values for key in range(min(input_array), max(input_array) + 1): integer_counts[key] += integer_counts[key - 1] # Build output array output_array = [0 for i in range(len(input_array))] for element in reversed(input_array): output_array[integer_counts[element] - 1] = element integer_counts[element] -= 1 return output_array def entry(input_array): return countsort(input_array) |
post a comment